import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * Slouzi pro spravu hernich kol
 */

public class NewTurn implements ActionListener {
	
	/**
	 * TODO odstranit static vyjma u turnNr a snad taky gml, viz GameLogic
	 */
	private static GameLogic gml = new GameLogic();
	private static int turnNr;
	
	//atributy nezavisle na jinych kolech
	private int numberThrown;
	private int numberOfTries = 3;
	private Figure thrownOutFigure = null;
	
	/**
	 * Action event handler
	 */
	public void actionPerformed(ActionEvent e) {
		gml.performTurn();
	}
	
	/**
	 * Vrati hod kostkou 
	 * @return cislo 1 - 6
	 */
	public int getNumberThrown() {
		return numberThrown;
	}
	
	/**
	 * Ulozi hod kostkou
	 * @param numberThrown hozene cislo
	 */
	public void setNumberThrown(int numberThrown) {
		this.numberThrown = numberThrown;
	}
	
	/**
	 * Nastavi cislo kola
	 * @param turnNr cislo kola
	 */
	public void setTurnNumber(int turnNr) {
		this.turnNr = turnNr;
	}
	
	/**
	 * Vrati cislo kola
	 * @return cislo kola
	 */
	public int getTurnNumber() {
		return turnNr;
	}
	
	public int getNumberOfTries() {
		return numberOfTries;
	}
	
	public void setNumberOfTries(int numberOfTries) {
		this.numberOfTries = numberOfTries; 
	}
	
	public void setThrownOutFigure(Figure thrownOutFigure) {
		this.thrownOutFigure = thrownOutFigure;
	}
	
	public Figure getThrownOutFigure() {
		return thrownOutFigure;
	}
	
	/**
	 * Vypise informace o danem kole
	 */
	public String toString() {
		return "Kolo: " + getTurnNumber() + "; v predchozim byl hod kostkou: " + getNumberThrown()+";";
	}
}